import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Ab06VO, Ab06Form, Ab06Query } from '@/api/yuanshidian/ab06/types';

/**
 * 查询个人账户年度计息列表
 * @param query
 * @returns {*}
 */

export const listAb06 = (query?: Ab06Query): AxiosPromise<Ab06VO[]> => {
  return request({
    url: '/yuanshidian/ab06/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询个人账户年度计息详细
 * @param ID
 */
export const getAb06 = (ID: string | number): AxiosPromise<Ab06VO> => {
  return request({
    url: '/yuanshidian/ab06/' + ID,
    method: 'get'
  });
};

/**
 * 新增个人账户年度计息
 * @param data
 */
export const addAb06 = (data: Ab06Form) => {
  return request({
    url: '/yuanshidian/ab06',
    method: 'post',
    data: data
  });
};

/**
 * 修改个人账户年度计息
 * @param data
 */
export const updateAb06 = (data: Ab06Form) => {
  return request({
    url: '/yuanshidian/ab06',
    method: 'put',
    data: data
  });
};

/**
 * 删除个人账户年度计息
 * @param ID
 */
export const delAb06 = (ID: string | number | Array<string | number>) => {
  return request({
    url: '/yuanshidian/ab06/' + ID,
    method: 'delete'
  });
};
